package xyz.xuminghai.javafx_learn.scene.effect;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.DropShadow;
import javafx.scene.effect.InnerShadow;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * 2023/7/6 16:03 星期四<br/>
 * 外阴影
 *
 * @author xuMingHai
 */
public class DropShadowApp extends Application {

    private final BorderPane root = new BorderPane();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Text text = new Text("DropShadow");
        text.setFont(Font.font(50.0));

        DropShadow dropShadow = new DropShadow(30.0, 10.0, 10.0, Color.ORANGE);
        InnerShadow innerShadow = new InnerShadow(5.0, 10.0, 10.0, Color.TOMATO);
        innerShadow.setInput(dropShadow);

        text.setEffect(innerShadow);


        root.setCenter(text);
    }


    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
